<?php
require_once './model/amazon/GetAmazonBookDetailInfo.php';
require_once './model/BookDetailEntity.php';
/**
 * 
 * @author prg
 *
 */
class DetailController
{
	private $from_tag;
	private $detail_url;
	private $base_book;
	private $detail_entity;
	
	function __construct($book,$detail_url,$from_tag)
	{
		$this->base_book = $book;
		$this->detail_url= $detail_url;
		$this->from_tag	 = intval($from_tag);	
	}
	function getBookDetailInfo()
	{
		
		//var_dump($this->base_book);
		
		switch ($this->from_tag)
		{
			case BookBaseEntity::AMAZON :
				{
					$this->getAmazonDetailInfo();
				}
			case BookBaseEntity::DANG :
				{
					
				}
			case BookBaseEntity::WIN:
				{
					
				}
		}
		
		return $this->detail_entity;
	}
	
	function getAmazonDetailInfo()
	{
		$amazonModel = new GetAmazonBookDetailInfo($this->detail_url, $this->base_book);
		
		$this->detail_entity=$amazonModel->getDetailBookEntity();
	}
}
?>